﻿using System;
using System.Web;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Diagnostics;
using System.Web.Mvc;

namespace FILSTARTUPS_CMS.Models
{
    public class Post
    {
        [Key]
        public int postidPK { get; set; }

        [Column]
        [Display(Name="Post Title")]
        [Required(ErrorMessage="Post title is required")]
        public string posttitle { get; set; }
        
        [Column]
        [Display(Name="Post Description")]
        [AllowHtml]
        [DataType(DataType.Html)]
        [UIHint("Html")]
        public string postdescription { get; set; }

        [Column]
        [DisplayFormat(DataFormatString = "{0:MMMM d, yyyy}")]
        public DateTime datecreated { get; set; }

        [Column]
        [Display(Name="Featured Post")]
        public bool featuredpost { get; set; }

        [Column]
        public int catidFK { get; set; }
       
        [Column]
        //[ForeignKey("User")]
        public int useridFK { get; set; }
        
        public int routingidFK { get; set; }

        public byte[] image { get; set; }


        public string filename { get; set; }

        public string imagetype { get; set; }

    }
    public class PostGrid
    {
        public string filename { get; set; }
        public int postidPK { get; set; }
        public string posttitle { get; set; }
        public string postdescription { get; set; }
        public string categoryname { get; set; }
        public string viewtype { get; set; }
        public DateTime datecreated { get; set; }
    }
    public class TotalPost
    {
        public IEnumerable<Post> post_ { get; set; }
        public IEnumerable<Category> cat_ { get; set; }
    }
}